using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using BusinessObjects;

namespace DataObjects
{
    /// <summary>
    /// Defines methods to access products.
    /// </summary>
    /// <remarks>
    /// This is a database-independent interface. Implementations are database specific.
    /// </remarks>
    public interface IProductDao
    {
        /// <summary>
        /// Gets a list of products for a given category.
        /// </summary>
        /// <param name="categoryId">Unique category identifier.</param>
        /// <param name="sortExpression">Sort order.</param>
        /// <returns>Sorted list of products.</returns>
        List<Product> GetProductsByCategory(int categoryId, string sortExpression);

        /// <summary>
        /// Performs a search for products given several criteria.
        /// </summary>
        /// <param name="productName">Product name criterium.</param>
        /// <param name="priceFrom">Low end of price range.</param>
        /// <param name="priceThru">High end of price range.</param>
        /// <param name="sortExpression">Sort order.</param>
        /// <returns>Sorted list of products.</returns>
        List<Product> SearchProducts(int categoryId, string sortExpression);

        /// <summary>
        /// Gets a specific product.
        /// </summary>
        /// <param name="productId">Unique product identifier.</param>
        /// <returns>Product.</returns>
        Product GetProduct(int productId,int categoryId);

        /// <summary>
        /// Inserts a new product. 
        /// </summary>
        /// <remarks>
        /// Following insert, product object will contain the new identifier.
        /// </remarks>
        /// <param name="product">Product.</param>
        void InsertProduct(Product product);

        /// <summary>
        /// Updates a product.
        /// </summary>
        /// <param name="product">Product.</param>
        void UpdateProduct(Product product);

        /// <summary>
        /// TAIPM : 09/01/2011
        /// Book a product.
        /// </summary>
        /// <param name="product">productId.</param>
        /// <param name="product">statusId.</param>
        void Book(int productId, int statusId);

        /// <summary>
        /// Deletes a product
        /// </summary>
        /// <param name="product">Product.</param>
        void DeleteProduct(Product product);

        void DeleteProductByCategoryId(int categoryId);
    }
}
